$().ready(function(){
    var nav = getSearch('nav');
    var item = getSearch('item');
    let navList;
    for(let i in mainList){
        if(nav == mainList[i].id){
            navList = mainList[i];
        }
    }
    for(let j in navList.list){
        if(item == navList.list[j].id){
            navItem = navList.list[j]
        }
    }
    var breadcream = '<a href="index.html">首页</a>';
    breadcream += '<a href="'+navList.link+'?nav='+navList.id+'">'+navList.name+'</a>';
    breadcream += '<a href="">'+navItem.name+'</a>';
    $('#breadcream').html(breadcream);
    var apiUrl = '/Api/New/get_ldtd';
    getAjax(apiUrl,res=>{
        console.log(res);
        var html = '';
        for(var i in res){
            html += '<div class="ldtd-list">';
            html += '<div class="ldtd-img" style="background: url(\''+res[i].img+'\') no-repeat center center/cover">';
            html += '</div>';
            html += '<div class="ldtd-content">';
            html += '<div class="ldtd-title">'+res[i].title+'</div>';
            html += '<div class="ldtd-intro">'+res[i].content+'</div>';
            html += '</div></div>';
        }
        $('#main-box').html(html);
    })
})
